package cn.lizemin.demo.time;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class TimeTest {
    //这是一个main方法,是程序的入口
    public static void main(String[] args) {
        LocalDateTime dateTime = LocalDateTime.now();
        System.out.println(dateTime);

        LocalDate date = LocalDate.now();
        System.out.println(date);
        System.out.println("-------------------------");
        //体会不变性
        LocalDateTime dateTime1 = dateTime.withMonth(8);
        System.out.println(dateTime1);
        System.out.println(dateTime);

    }

}
